<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Samples</title>
<link type="text/css" rel="stylesheet" href="http://www.gstatic.com/codesite/ph/5121560014714628542/css/core.css" />
<link type="text/css" rel="stylesheet" href="http://www.gstatic.com/codesite/ph/5121560014714628542/css/ph_detail.css" />
<meta name="robots" content="index, follow" />
<style type="text/css">
	.psdescription {width:auto;}
</style>
</head>

<body>
<div class="psdescription" id="wikicontent">
  <p>aspjson is JSON serializer for VBScript based ASP server technology. </p>
  <p>It uses VBScript's primitive types except Object and Array types. <tt>jsObject</tt> and <tt>jsArray</tt> classes stand JSON Object and Array dynamically on server side. These classes derive core functionality from <tt>jsCore</tt>. </p>
  <p>aspjson supports nested types for block of buildings, such as <tt>jsObject</tt> instances can contain <tt>Number</tt>s, <tt>String</tt>s, <tt>Null</tt>s, <tt>Array</tt>s and other primitive types, <tt>jsArray</tt> instances can contain these <tt>jsObject</tt> instances or all of the primitive types. </p>
  <h2><a name="Hello_World!"></a>Hello World!<a class="section_anchor" href="#Hello_World!"></a></h2>
  <h3><a name="sample"></a>sample<a class="section_anchor" href="#sample"></a></h3>
  <pre class="prettyprint"><span class="com">&lt;!--#include file="JSON_latest.asp"--&gt;</span><span class="pln"><br></span><span class="pun">&lt;%</span><span class="pln"><br></span><span class="typ">Dim</span><span class="pln"> member<br></span><span class="typ">Set</span><span class="pln"> member </span><span class="pun">=</span><span class="pln"> jsObject</span><span class="pun">()</span><span class="pln"><br><br>member</span><span class="pun">(</span><span class="str">"name"</span><span class="pun">)</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="str">"Tuğrul"</span><span class="pln"><br>member</span><span class="pun">(</span><span class="str">"surname"</span><span class="pun">)</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="str">"Topuz"</span><span class="pln"><br>member</span><span class="pun">(</span><span class="str">"message"</span><span class="pun">)</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="str">"Hello World"</span><span class="pln"><br><br>member</span><span class="pun">.</span><span class="typ">Flush</span><span class="pln"><br>%&gt;</span></pre>
  <h3><a name="output"></a>output<a class="section_anchor" href="#output"></a></h3>
  <pre class="prettyprint"><span class="pun">{</span><span class="str">"name"</span><span class="pun">:</span><span class="str">"Tu\u011Frul"</span><span class="pun">,</span><span class="str">"surname"</span><span class="pun">:</span><span class="str">"Topuz"</span><span class="pun">,</span><span class="str">"message"</span><span class="pun">:</span><span class="str">"Hello World"</span><span class="pun">}</span></pre>
  <h2><a name="SQL_Queries"></a>SQL Queries<a class="section_anchor" href="#SQL_Queries"></a></h2>
  <h3><a name="sample"></a>sample<a class="section_anchor" href="#sample"></a></h3>
  <pre class="prettyprint"><span class="com">&lt;!--#include file="JSON_latest.asp"--&gt;</span><span class="pln"><br></span><span class="com">&lt;!--#include file="JSON_UTIL_latest.asp"--&gt;</span><span class="pln"><br></span><span class="pun">&lt;%</span><span class="pln"><br></span><span class="typ">QueryToJSON</span><span class="pun">(</span><span class="pln">dbconn</span><span class="pun">,</span><span class="pln"> </span><span class="str">"SELECT name, surname FROM members WHERE age &lt; 30"</span><span class="pun">).</span><span class="typ">Flush</span><span class="pln"><br>%&gt;</span></pre>
  <h3><a name="output"></a>output<a class="section_anchor" href="#output"></a></h3>
  <pre class="prettyprint"><span class="pun">[</span><span class="pln"><br>&nbsp; &nbsp; </span><span class="pun">{</span><span class="pln"><br>&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="str">"name"</span><span class="pun">:</span><span class="str">"ali"</span><span class="pun">,</span><span class="pln"><br>&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="str">"surname"</span><span class="pun">:</span><span class="str">"osman"</span><span class="pln"><br>&nbsp; &nbsp; </span><span class="pun">},</span><span class="pln"><br>&nbsp; &nbsp; </span><span class="pun">{</span><span class="pln"><br>&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="str">"name"</span><span class="pun">:</span><span class="str">"mahmut"</span><span class="pun">,</span><span class="pln"><br>&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="str">"surname"</span><span class="pun">:</span><span class="str">"\u00E7\u0131nar"</span><span class="pln"><br>&nbsp; &nbsp; </span><span class="pun">}</span><span class="pln"><br></span><span class="pun">]</span></pre>
  <h2><a name="Multi_Dimensional_Arrays"></a>Multi Dimensional Arrays<a class="section_anchor" href="#Multi_Dimensional_Arrays"></a></h2>
  <h3><a name="sample"></a>sample<a class="section_anchor" href="#sample"></a></h3>
  <pre class="prettyprint"><span class="com">&lt;!--#include file="JSON_latest.asp"--&gt;</span><span class="pln"><br></span><span class="pun">&lt;%</span><span class="pln"><br></span><span class="typ">Dim</span><span class="pln"> a</span><span class="pun">(</span><span class="lit">1</span><span class="pun">,</span><span class="lit">1</span><span class="pun">)</span><span class="pln"><br><br>a</span><span class="pun">(</span><span class="lit">0</span><span class="pun">,</span><span class="lit">0</span><span class="pun">)</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="str">"zero - zero"</span><span class="pln"><br>a</span><span class="pun">(</span><span class="lit">0</span><span class="pun">,</span><span class="lit">1</span><span class="pun">)</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="str">"zero - one"</span><span class="pln"><br>a</span><span class="pun">(</span><span class="lit">1</span><span class="pun">,</span><span class="lit">0</span><span class="pun">)</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="str">"one - zero"</span><span class="pln"><br>a</span><span class="pun">(</span><span class="lit">1</span><span class="pun">,</span><span class="lit">1</span><span class="pun">)</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="str">"one - one"</span><span class="pln"><br><br></span><span class="typ">Response</span><span class="pun">.</span><span class="typ">Write</span><span class="pln"> toJSON</span><span class="pun">(</span><span class="pln">a</span><span class="pun">)</span><span class="pln"><br>%&gt;</span></pre>
  <h3><a name="output"></a>output<a class="section_anchor" href="#output"></a></h3>
  <pre class="prettyprint"><span class="pun">[[</span><span class="str">"zero - zero"</span><span class="pun">,</span><span class="str">"zero - one"</span><span class="pun">],[</span><span class="str">"one - zero"</span><span class="pun">,</span><span class="str">"one - one"</span><span class="pun">]]</span></pre>
  <p><a href="http://sonucu.org/">sonucu</a></p>
</div>
</body>
</html>
